package source;

import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;

public class Player {

	private String name;
	private int score;
	private List<RPSEnum> movesList;
	private ListIterator<RPSEnum> iterator;

	public Player(String name, int score, List<RPSEnum> moves) {
		this.name = name;
		this.score = score;
		this.movesList = moves;
		this.iterator = moves.listIterator();
	}

	public Player(String name) {
		this.name = name;
		this.score = 0;	
		this.movesList = new ArrayList<RPSEnum>();
		this.iterator = movesList.listIterator();
		for (int i = 0; i < 10; i++) {
			int random = (int) (Math.random() * (2));
			switch (random) {
			case 0:
				this.movesList.add(RPSEnum.ROCK);
				break;
			case 1:
				this.movesList.add(RPSEnum.PAPER);
				break;
			case 2:
				this.movesList.add(RPSEnum.SCISSORS);
				break;
			default:
				break;

			}

		}

	}

	public String getName() {
		return this.name;
	}

	public int getScore() {
		return this.score;
	}

	public int getRPSEnumLength() {
		return this.movesList.size();
	}

	public RPSEnum getNextMove() {
		return this.iterator.next();
	}

	public void setScore(int score) {
		this.score = score;
	}

}
